const { spawn } = require('child_process');

const cp = spawn('./large-output');
cp.stdout.on('data', (result)=>{
 console.log(result.toString());
});

cp.stderr.on('data', (result)=>{
  console.log('error', result.toString());
})
